;;; srecode-getset-java.srt --- Create getter/setters for a Java class.

;; Copyright (C) 2008 Espen Wiborg <espenhw@grumblesmurf.org>

;; Author: Espen Wiborg <espenhw@grumblesmurf.org>

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.

;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

set mode "java-mode"
set application "getset"

context declaration

template getset-in-class :tag :indent :blank
----
public {{TYPE}} get{{NAME:subword-capitalize-string}}() {
   return {{NAME}};
}

public void set{{NAME:subword-capitalize-string}}({{TYPE}} {{NAME}}) {
   this.{{NAME}} = {{NAME}};
}

----

template getset-field :blank :indent
----
private {{?TYPE}} {{?NAME}};
----
;; end

